package Merlion.util.helper;

import java.util.Calendar;
import java.util.Date;

public class DateOperator {

    Calendar calendar = Calendar.getInstance();

    public Date addDays(Date date, int NoOfDays) {
        calendar.setTime(date);
        calendar.add(Calendar.DATE, NoOfDays);
        Date newDate = calendar.getTime();
        return newDate;
    }

    public Date addWeeks(Date date, int NoOfWeeks) {
        calendar.setTime(date);
        calendar.add(Calendar.WEEK_OF_YEAR, NoOfWeeks);
        Date newDate = calendar.getTime();
        return newDate;
    }

    public Date addMonths(Date date, int MonthNum) {
        calendar.setTime(date);
        calendar.add(Calendar.MONTH, MonthNum);
        Date newDate = calendar.getTime();
        return newDate;
    }
}
